package com.gf.firstDemo;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@EnableAutoConfiguration
@RestController
@RequestMapping("/springboot")
public class UserController {

	@Autowired
	User user;
	
	List<Address> list;

	@RequestMapping(value = "/{name}", method = RequestMethod.GET)
	@ResponseBody
	public User sayWorld(@PathVariable("name") String name) {
		System.out.println("userName:" + user.getName());
		return user;
	}
	
	@RequestMapping(value = "/list/{name}", method = RequestMethod.GET)
	@ResponseBody
	public List<Address> address(@PathVariable("name") String name) {
//		System.out.println("userName:" + user.getName());
		return list;
	}
}
